<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>

<%@taglib uri="/struts-tags" prefix="s"%>

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Pizzaria SENAC - Listar Pizzas</title>
<s:head />
<style type="text/css">
@import url(css/style.css);
</style>
</head>
</head>
<body>

	<s:form theme="xhtml">

		<s:if test="listaPizzas.size() > 0">

			<h1>Lista de Pizzas Cadastradas</h1>

			<div class="content">
				<table class="userTable" cellpadding="5px">
					<tr class="even">
						<th>Nome</th>
						<th>Descrição</th>
						<th>Preço</th>
						<th colspan="2">Ações</th>									
					</tr>

					<s:iterator value="listaPizzas" status="pizza">
						<tr
							class="<s:if test="#pizza.odd == true ">odd</s:if> <s:else>even</s:else>">
							<td><s:property value="nome" /></td>
							<td><s:property value="descricao" /></td>
							<td><s:property value="preco" /></td>							

							<td><s:url id="editURL" action="alterarPizza">
									<s:param name="id" value="%{id}"></s:param>
								</s:url> <s:a href="%{editURL}">Editar</s:a></td>
							<td><s:url id="deleteURL" action="excluirPizza">
									<s:param name="id" value="%{id}"></s:param>
								</s:url> <s:a href="%{deleteURL}">Deletar</s:a></td>
						</tr>
					</s:iterator>
				</table>
			</div>

		</s:if>
				
		<br>
		
		<a href="index.jsp">Página Inicial</a>
		
		<br><br>
		
		<a href="cadastrapizza.jsp">Cadastrar Nova Pizza</a>

	</s:form>

	

</body>
</html>